home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d11 / ev678dev.arc / VGABIOS.DOC < prev    next >
Text File  |  1990-07-03  |  17KB  |  548 lines

  1. -------------------------------------------------------------------------
  2. |            VGABIOS.DOC                    |
  3. |    This document describes the IBM Standard VGA BIOS functions     |
  4. |    and their usage.                        |
  5. -------------------------------------------------------------------------
  6.  
  7. The following is a summary of the standard IBM VGA BIOS functions:
  8.  
  9. ;***************************************************************
  10.  
  11. ah = 00h - Set Mode
  12. ah = 01h - Set Cursor Type
  13. ah = 02h - Set Cursor Position
  14. ah = 03h - Read Cursor Position
  15. ah = 04h - Read Light Pen Position (EGA and CGA only)
  16. ah = 05h - Select Active Display Page
  17. ah = 06h - Scroll Active Page Up
  18. ah = 07h - Scroll Active Page Down
  19. ah = 08h - Read Attribute/Character at Cursor Position
  20. ah = 09h - Write Attribute/Character at Cursor Position (Graphics)
  21. ah = 0Ah - Write Character at Cursor Position        (Text)
  22. ah = 0Bh - Set Color Palette
  23. ah = 0Ch - Write Dot
  24. ah = 0Dh - Read Dot
  25. ah = 0Eh - Write TTY to Active Page
  26. ah = 0Fh - Read Video State
  27. ah = 10h - Set Palette Registers
  28. ah = 11h - Character Generator
  29. ah = 12h - Alternate Select
  30. ah = 13h - Write String
  31. ah = 14h - reserved (PC Convertible only)
  32. ah = 15h - reserved (PC Convertible only)
  33. ah = 16h - reserved
  34. ah = 17h - reserved
  35. ah = 18h - reserved
  36. ah = 19h - reserved
  37. ah = 1Ah - Read/Write Display Combination Code
  38. ah = 1Bh - Return Functionality/State Information
  39. ah = 1Ch - Save/Restore Video State
  40.  
  41. ;***************************************************************
  42. Set Mode (ah = 00h)
  43.  
  44. Entry:    ah = 00h
  45.     al = mode# (0..13h) => Set standard IBM mode
  46.        = 70h => Set Everex Extended mode 
  47.         bl = Everex Extended mode number
  48.  
  49.     (if b7 of al is set, the video buffer is not cleared)
  50.  
  51. Exit :    None
  52.  
  53. ;***************************************************************
  54. Set Cursor Type (ah = 01h)
  55.  
  56. Entry:    ah = 01h
  57.     ch = Starting line for cursor
  58.     cl = Ending line for cursor
  59.  
  60. Exit :    None
  61.  
  62. ;***************************************************************
  63. Set Cursor Position (ah=02h)
  64.  
  65. Entry:    ah = 02h
  66.     bh = Page#
  67.     dh,dl = Row,column of cursor position
  68.  
  69. Exit :    None
  70.  
  71. ;***************************************************************
  72. Read Cursor Position (ah=03h)
  73.  
  74. Entry:    ah = 03h
  75.     bh = Page#
  76.  
  77. Exit :    ch,cl = Current cursor type
  78.     dh,dl = Row,column of cursor for requested page
  79.  
  80. ;***************************************************************
  81. Read Light Pen Position (ah=04h)
  82.  
  83. NOTE: Light Pen is not available on VGA adapters.
  84.  
  85. Entry:    ah = 04h
  86.  
  87. Exit :    ah = 00h => Light pen switch not activated
  88.         bx,cx,dx are altered
  89.        = 01h => Light pen position successful
  90.         bx = PEL column (0..X)
  91.         ch = raster line (0..199) (200 line modes)
  92.         cx = raster line (0..Y)   (new graphics modes)
  93.         dh,dl = Row,column of character
  94.  
  95. ;***************************************************************
  96. Select Active Display Page (ah=05h)
  97.  
  98. Entry:    ah = 05h
  99.     al = Page#
  100.  
  101. Exit :    None
  102.  
  103. ;***************************************************************
  104. Scroll Active Page Up (ah=06h)
  105.  
  106. Entry:    ah = 05h
  107.     al = # of lines to blank at the bottom
  108.        = 00h to blank the entire window
  109.     bh = Blanking attribute
  110.     ch,cl = Row,column of upper left corner
  111.     dh,dl = Row,column of lower right corner
  112.  
  113. Exit :    None
  114.  
  115. ;***************************************************************
  116. Scroll Active Page Down (ah=07h)
  117.  
  118. Entry:    ah = 07h
  119.     al = # of lines to blank at the top
  120.        = 00h to blank the entire window
  121.     bh = Blanking attribute
  122.     ch,cl = Row,column of upper left corner
  123.     dh,dl = Row,column of lower right corner
  124.  
  125. Exit :    None
  126.  
  127. ;***************************************************************
  128. Read Attribute/Character at Cursor Position (ah=08h)
  129.  
  130. Entry:    ah = 08h
  131.     bh = Page#
  132.  
  133. Exit :    ah = Attribute of character read (Text modes only)
  134.     al = character read
  135.  
  136. ;***************************************************************
  137. Write Attribute/Character at Cursor Position (ah=09h)
  138.  
  139. Entry:    ah = 09h
  140.     al = Character to write
  141.     bh = Page#
  142.     bl = Attribute of character to write
  143.     cx = Count of characters to write
  144.  
  145.     (For 256 color modes, bh is used as the background color)
  146.     (For non-256 color graphics modes, if b7 of bl is set, the 
  147.     color value is XORed)
  148.  
  149. Exit :    None
  150.  
  151. ;***************************************************************
  152. Write Character at Cursor Position (ah=0Ah)
  153.  
  154. Entry:    ah = 0Ah
  155.     al = Character to write
  156.     bh = Page#
  157.     cx = Count of characters to write
  158.  
  159. Exit :    None
  160.  
  161. ;***************************************************************
  162. Set Color Palette (ah=0Bh)
  163.  
  164. Entry:    ah = 0Bh
  165.     bh = 00h => Set background color for 320x200 graphics modes
  166.          => Set foreground color for 640x200 graphics modes
  167.          => Set border color for alphanumeric modes
  168.         bl = (0..31)
  169.        = 01h => Select palette for 320x200 graphics modes
  170.         bl = 0 => Green/red/brown
  171.             = 1 => Cyan/magenta/white
  172.  
  173. Exit :    None
  174.  
  175. ;***************************************************************
  176. Write Dot (ah=0Ch)
  177.  
  178. Entry:    ah = 0Ch
  179.     al = Color value
  180.     bh = Page#
  181.     dx,cx = Row,column of pixel
  182.  
  183.     (In non-256 color modes, if b7 of al is set then the color is XORed)
  184.  
  185. Exit :    None
  186.  
  187. ;***************************************************************
  188. Read Dot (ah=0Dh)
  189.  
  190. Entry:    ah = 0Dh
  191.     bh = Page#
  192.     dx,cx = Row,column of pixel
  193.  
  194. Exit :    al = Color value
  195.  
  196. ;***************************************************************
  197. Write TTY to Active Page (ah=0Eh)
  198.  
  199. Entry:    ah = 0Eh
  200.     al = Character to write
  201.     bl = Foreground color (Graphics modes only)
  202.  
  203. Exit :    None
  204.  
  205. ;***************************************************************
  206. Read Video State (ah=0Fh)
  207.  
  208. Entry:    ah = 0Fh
  209.  
  210. Exit :    al = Current mode#
  211.     ah = Columns
  212.     bh = Active page#
  213.  
  214.     (If an Everex Extended mode is active, al will contain the base mode)
  215.  
  216. ;***************************************************************
  217. Set Palette Registers (ah=10h)
  218.  
  219. Entry:    ah = 10h
  220.     al = 00h => Set one palette register
  221.         bl = Palette register#
  222.         bh = value to set
  223.        = 01h => Set overscan register
  224.         bh = value to set
  225.        = 02h => Set all palette registers and overscan
  226.         es:dx -> 17 byte table
  227.        = 03h => Toggle intensify/blinking bit
  228.         bl = 00h => Enable intensify
  229.            = 01h => Enable blinking
  230.  
  231.        = 07h => Read one palette register
  232.         bl = Palette register#
  233.         Exit:    bh = value read
  234.        = 08h => Read overscan register
  235.         Exit:    bh = value read
  236.        = 09h => Read all palette registers and overscan
  237.         es:dx -> 17 byte table
  238.  
  239.        = 10h => Set individual color register
  240.         bx = Color register#        (0..FFh)
  241.         dh = Red value            (0..3Fh)
  242.         ch = Green value        (0..3Fh)
  243.         cl = Blue value            (0..3Fh)
  244.        = 12h => Set block of color registers
  245.         bx = First color register#    (0..FFh)
  246.         cx = Count of color registers
  247.         es:dx -> Table of size 3*cx bytes.  Each
  248.             triple forms a Red,Green,Blue to be
  249.             written to one color register
  250.        = 13h => Select color page (not valid in 256 color modes)
  251.         bl = 00h => Select paging mode
  252.             bh = 00h => Select  4 blocks of 64 registers
  253.                = 01h => Select 16 blocks of 16 registers
  254.         bl = 01h => Select page
  255.             bh = Page# (00h..03h or 00h..0Fh)
  256.        = 15h => Read one color register
  257.         bl = Color register#
  258.         Exit:    dh = Red value
  259.             ch = Green value
  260.             cl = Blue value
  261.        = 17h => Read block of color registers
  262.         bx = First color register#    (0..FFh)
  263.         cx = Count of color registers
  264.         es:dx -> Table of size 3*cx bytes.
  265.         Exit:    es:dx -> Table of size 3*cx bytes.  Each triple
  266.             forms a Red,Green,Blue value read from one color
  267.             register.
  268.        = 18h => (Undocumented) Set PEL Mask
  269.         bl = new PEL mask
  270.         (This value is ANDed with each color value before looking
  271.         up the color in the digital-to-analog converter (DAC))
  272.        = 19h => (Undocumented) Read PEL Mask
  273.         bl = value read
  274.        = 1Ah => Read color page state
  275.         Exit:    bl = paging mode
  276.             bh = current page
  277.        = 1Bh => Sum a block of colors to gray shades
  278.         bx = Starting color register#
  279.         cx = # of color registers to convert
  280.  
  281. ;***************************************************************
  282. Character Generator (ah=11h)
  283.  
  284. Entry:    ah = 11h
  285.     al = 00h => User alpha font load w/set mode
  286.         bh = bytes/character
  287.         bl = block#
  288.         cx = count to store
  289.         dx = character offset to start at
  290.         es:bp -> font table of size cx*bh bytes
  291.     al = 01h => ROM 8x14 font load w/set mode
  292.         bl = block#
  293.     al = 02h => ROM 8x8 font load w/set mode
  294.         bl = block#
  295.     al = 03h => Set block specifier
  296.         bl - b4,b1,b0 select normal intensity font block
  297.         bl - b5,b3,b2 select high intensity font block
  298.     al = 04h => ROM 8x16 load w/set mode
  299.         bl = block#
  300.  
  301.     al = 10h => User alpha font load w/o set mode
  302.         bh = bytes/character
  303.         bl = block#
  304.         cx = count to store
  305.         dx = character offset to start at
  306.         es:bp -> font table of size cx*bh bytes
  307.     al = 11h => ROM 8x14 font load w/o set mode
  308.         bl = block#
  309.     al = 12h => ROM 8x8 font load w/o set mode
  310.         bl = block#
  311.     al = 14h => ROM 8x16 load w/o set mode
  312.         bl = block#
  313.  
  314.     al = 20h => Set user graphics pointer at INT 1Fh
  315.         es:bp -> user font table
  316.     al = 21h => Set user graphics pointer at INT 43h for user font
  317.         es:bp -> user font table
  318.         cx = bytes/character
  319.         bl = Row specifier
  320.            = 00h => User row count
  321.             dl = # of rows
  322.            = 01h => 14 rows
  323.            = 02h => 25 rows
  324.            = 03h => 43 rows
  325.     al = 22h => Set user graphics pointer at INT 43h for ROM 8x14
  326.         bl = Row specifier
  327.     al = 23h => Set user graphics pointer at INT 43h for ROM 8x8
  328.         bl = Row specifier
  329.     al = 24h => Set user graphics pointer at INT 43h for ROM 8x16
  330.         bl = Row specifier
  331.     al = 30h => Return font information
  332.         bh = font pointer requested
  333.         Exit:    cx = bytes/character
  334.             dl = # rows -1
  335.             es:bp -> font requested
  336.                 bh = 00h => es:bp =  INT 1Fh font pointer
  337.                 bh = 01h => es:bp =  INT 43h font pointer
  338.                 bh = 02h => es:bp -> ROM 8x14 font
  339.                 bh = 03h => es:bp -> ROM 8x8 font (00h to 7Fh)
  340.                 bh = 04h => es:bp -> ROM 8x8 font (80h to FFh)
  341.                 bh = 05h => es:bp -> ROM 9x14 alt font
  342.                 bh = 06h => es:bp -> ROM 8x16 font
  343.                 bh = 07h => es:bp -> ROM 9x16 alt font
  344.  
  345. ;***************************************************************
  346. Alternate Select (ah = 12h)
  347.  
  348. Entry:    ah = 12h
  349.     bl = 10h => Return EGA information
  350.         Exit:    bh = 00h => Color mode in effect
  351.                = 01h => Monochrome mode in effect
  352.             bl = Memory size (0..3)
  353.             ch = Feature connector bits
  354.             cl = IBM EGA switch settings
  355.     bl = 20h => Revector print screen interrupt to EGA print screen
  356.     bl = 30h => Select # of scan lines for next text set mode
  357.         al = 00h => 200 scan lines (invalid for mode 7)
  358.            = 01h => 350 scan lines
  359.            = 02h => 400 scan lines
  360.         Exit:    al = 12h if the function was supported
  361.     bl = 31h => Enable/Disable default palette loading during set mode
  362.         al = 00h => Enable default palette loading
  363.            = 01h => Disable default palette loading
  364.         Exit:    al = 12h if the function was supported
  365.     bl = 32h => Enable/Disable video
  366.         al = 00h => Enable video
  367.            = 01h => Disable video
  368.         Exit:    al = 12h if the function was supported
  369.     bl = 33h => Enable/Disable gray summing
  370.         al = 00h => Enable gray summing
  371.            = 01h => Disable gray summing
  372.         Exit:    al = 12h if the function was supported
  373.     bl = 34h => Enable/Disable cursor emulation
  374.         al = 00h => Enable cursor emulation
  375.            = 01h => Disable cursor emulation
  376.         Exit:    al = 12h if the function was supported
  377.     bl = 36h => Video screen on/off
  378.         al = 00h => Video screen off
  379.            = 01h => Video screen on
  380.         Exit:    al = 12h if the function was supported
  381.  
  382. For IBM PS/2 computers:
  383.     bl = 35h => Display switch
  384.         al = 00h => Initial adapter off
  385.             es:dx -> 128 byte save area
  386.         al = 01h => Initial system board video on
  387.         al = 02h => Switch off active video
  388.             es:dx -> 128 byte save area
  389.         al = 03h => Switch on inactive video
  390.             es:dx -> 128 byte save area
  391.         al = 80h => (Undocumented) Set system board video active flag
  392.         Exit:    al = 12h if the function was supported
  393.         
  394. ;***************************************************************
  395. Write String (ah=13h)
  396.  
  397. Entry:    al = string format
  398.        = 00h => bl = attribute
  399.             string = ch,ch,ch,...        (cursor not moved)
  400.        = 01h => bl = attribute
  401.             string = ch,ch,ch,...        (cursor moved)
  402.        = 02h => string = ch,attr,ch,attr,...     (cursor not moved)
  403.                             (text modes only)
  404.        = 03h => string = ch,attr,ch,attr,...     (cursor moved)
  405.                             (text modes only)
  406.  
  407. ;***************************************************************
  408. Read/Write Display Combination Code (DCC) (ah=1Ah)
  409.  
  410. Entry:    ah = 1Ah
  411.     al = 00h => Read DCC
  412.         Exit:    bl = active display code
  413.             bh = alternate display code
  414.     al = 01h => Write DCC
  415.         bl = active display code
  416.         bh = alternate display code
  417.  
  418. Exit :    al = 1Ah if the function was supported
  419.  
  420. Valid display combination codes:
  421.     00h - no display
  422.     01h - monochrome adapter w/ monochrome display
  423.     02h - color graphics adapter w/ color display
  424.     03h - reserved
  425.     04h - Enhanced graphics adapter w/ color display
  426.     05h - Enhanced graphics adapter w/ monochrome display
  427.     06h - Professional graphics adapter w/ color display
  428.     07h - VGA w/ monochrome analog display
  429.     08h - VGA w/ color analog display
  430.     09h - reserved
  431.     0Ah - reserved
  432.     0Bh - MCGA w/ monochrome analog display
  433.     0Ch - MCGA w/ color analog display
  434.     FFh - unknown display type
  435.     
  436. ;***************************************************************
  437. Return Functionality/State Information (ah=1Bh)
  438.  
  439. Entry:    ah = 1Bh
  440.     bx = Implementation type
  441.        = 0000h => Return functionality/state information
  442.         es:di -> 40h byte buffer
  443.             (di+00) (dw)->Static functionality table
  444.             (di+04) (b) = video mode in effect
  445.             (di+05) (w) = # of columns
  446.             (di+07) (w) = Length of regen buffer in bytes
  447.             (di+09) (w) = Starting address of regen buffer
  448.             (di+0B) (w) = Cursor position for page 0
  449.                :
  450.                :
  451.             (di+19) (w) = Cursor position for page 7
  452.             (di+1B) (w) = Cursor type
  453.             (di+1D) (b) = Active display page
  454.             (di+1E) (w) = CRTC port address
  455.             (di+20) (b) = Current setting of register (3?8)
  456.             (di+21) (b) = Current setting of register (3?9)
  457.             (di+22) (b) = # of rows
  458.             (di+23) (w) = bytes/character
  459.             (di+25) (b) = DCC of active display
  460.             (di+26) (b) = DCC of alternate display
  461.             (di+27) (w) = # of colors supported in current mode
  462.             (di+29) (b) = # of pages supported in current mode
  463.             (di+2A) (b) = # of scan lines active
  464.                     (0,1,2,3) => (200,350,400,480)
  465.             (di+2B) (b) = Primary character block
  466.             (di+2C) (b) = Secondary character block
  467.             (di+2D) (b) = Miscellaneous flags
  468.                 b0 - All modes on all displays on
  469.                 b1 - Gray summing on
  470.                 b2 - Monochrome display attached
  471.                 b3 - Default palette loading disabled
  472.                 b4 - Cursor emulation enabled
  473.                 b5 - 0 => Intensity
  474.                      1 => Blinking
  475.                 b6,b7 - reserved
  476.             (di+2E..30) (b) - reserved
  477.             (di+31) (b) = Video memory (0,1,2,3)=>(200,350,400,480)
  478.             (di+32) (b) = Save pointer state flags
  479.                 b0 - 512 character set active
  480.                 b1 - Dynamic save area present
  481.                 b2 - Alpha font override active
  482.                 b3 - Graphics font override active
  483.                 b4 - Palette override active
  484.                 b5 - DCC override present
  485.                 b6,b7 - reserved
  486.             (di+33..3F) - reserved
  487.  
  488. Static Funcionality Table format (10h bytes):
  489.     +00 = Modes supported #1
  490.         b0..b7 = 1 => corresponding mode (0,1,2,3,4,5,6,7) supported
  491.     +01 = Modes supported #2
  492.         b0..b7 = 1 => corresponding mode (8,9,A,B,C,D,E,F) supported
  493.     +02 = Modes supported #3
  494.         b0..b3 = 1 => corresponding mode (10,11,12,13) supported
  495.         b4..b7 - reserved
  496.     +03..+06 - reserved
  497.     +07 = Scan lines supported
  498.         b0..b2 = 1 => corresponding lines (200,350,400) supported
  499.         in text modes
  500.     +08 = Maximum number of active character blocks in text modes
  501.     +09 = Total blocks available in text modes
  502.     +0A = Miscellaneous function flags #1
  503.         b0 - All modes on all displays function supported
  504.         b1 - Gray summing function supported
  505.         b2 - Character font loading function supported
  506.         b3 - Default palette loading enable/disable supported
  507.         b4 - Cursor emulation function supported
  508.         b5 - EGA palette present
  509.         b6 - Color palette present
  510.         b7 - Color paging function supported
  511.     +0B = Miscellaneous funcion flags #2
  512.         b0 - Light pen supported
  513.         b1 - Save/restore state function 1C supported
  514.         b2 - Intensity/blinking function supported
  515.         b3 - Display Combination Cide (DCC) supported
  516.         b4..b7 - reserved
  517.     +0C..+0D - reserved
  518.     +0E = Save pointer function flags
  519.         b0 - 512-character set supported
  520.         b1 - Dynamic save area supported
  521.         b2 - Alpha font override supported
  522.         b3 - Graphics font override supported
  523.         b4 - Palette override supported
  524.         b5 - DCC extension supported
  525.         b6,b7 - reserved
  526.     +0F - reserved
  527.  
  528. ;***************************************************************
  529. Save/Restore Video State (ah=1Ch)
  530.  
  531. Entry:    ah = 1Ch
  532.     cx = Requested states
  533.         b0 - Video hardware
  534.         b1 - BIOS data areas
  535.         b2 - Color registers and state
  536.         b3..b7 - reserved
  537.     al = 00h => Calculate buffer size for requested statesin 64 byte blocks
  538.         Exit:    bx = buffer size to save requested states
  539.     al = 01h => Save requested states
  540.         es:bx -> Buffer of sufficient size to save requested states
  541.     al = 02h => Restore requested states
  542.         es:bx -> Buffer containing previously saved state
  543.         
  544. Exit :    al = 1Ch => Function supported
  545.  
  546. ;***************************************************************
  547. 
  548.